Assign bolt to selected object
= Components added: = Bolt.cs * Bolt Moves Separate This is for weapons that have separate bolts and charging handles. If this is checked, when the weapon fires the bolt itself will move back, but the charging handle will not. However, it will move the bolt AND the charging handle back when grabbed with a controller. * Slide Time in Frames This is how many frames it takes for the bolt to move from fully closed to fully open, and vice versa. Keep in mind that if your weapon's fire rate is faster than the bolt's ability to move, it will only fire as quickly as the bolt is able to make a full cycle and chamber a new round. For example, if you have a fire rate of 0.1, but the Slide Time is 5, the time required for the bolt to chamber a new round is (5 * 2 / 90) seconds, or 0.111 seconds, so the fire rate is effectively restricted to 0.111 instead of 0.1. Conversely, if the fire rate is longer than the bolt's ability to chamber a new round, the bolt will chamber a new round but the weapon will be unable to fire again until the fire rate permits it. * Start Chambered If this is checked, the weapon will attempt to chamber a round when the scene is loaded. Keep in mind, the weapon must have a magazine loaded for this to correctly function. * Bolt Group This is only assigned if Bolt Moves Separate '''is checked. The bolt group should be the charging handle, with the actual bolt as a child of the charging handle. * ''Bolt'' This is the part that moves when the round is fired. It is capable of positional and rotational movement. If '''Bolt Moves Separate is checked, this object should be a child of the Bolt Group. * Group Start and End Positions These are the positional adjustments for the Bolt Group. '''Group Start Position is the position of the Bolt Group when fully closed, End Position is fully open. These may be assigned using the '''Set Group Start Position and Set Group End Position buttons found at the bottom of the inspector for this component, and can be toggled between using the Toggle Position button. * Bolt Start and End Positions These are the positional adjustments for the actual bolt object. Start Position is fully closed, end position is fully open. The bolt will travel from start, to end, and back every time the weapon is fired, at the rate defined by Slide Time in Frames, '''unless a magazine is inserted and empty, in which case the bolt will lock to the end position. The positions may be assigned using the '''Set bolt Start Position '''and '''Set bolt End Position buttons, and can be toggled between using the Toggle Position button. * Bolt Rotates Until Sets the threshold for bolt rotation, from 0 to 1. If set to 0, bolt will not rotate. If set to 1, bolt will only rotate. This value will cause the bolt to rotate from its start rotation to its end rotation, and then move positionally, depending on what this value is. For example, if the value is 0.25, the bolt will only rotate for the first quarter of its movement, and the remaining 0.75 will move from the start position to the end position. * Bolt Rotation Start and End Positions These are the rotational adjustments for the bolt object. Rotation Start is fully closed, Rotation End is fully rotated. The rotations may be assigned using the Set rotation Start Position '''and '''Set rotation End Position buttons, and can be toggled using the Toggle rotation button. * Chambered Round Snap Transform This is the location of rounds on the bolt face. Toggle the bolt back, place a round on the bolt face where desired, assign this field, and hit the Assign Round Snap Location button. This button will set the round's parent to the bolt, and disable its Game Object. Bolt Grab Point This inherits VRTK's Interactable Object script. It communicates directly with the bolt object, and as the grab point moves, the bolt will move with it. The Bolt Grab Point should be a Game Object set as a child of the weapon itself, with a Collider and a Kinematic Rigidbody to ensure it detects collisions properly. * Bolt Closed and Open Positions Align the Grab Point with the location which the bolt should be grabbed, and press the Set Start Position button. Then, align the Grab Point with the desired fully-open hand position, and press the Set End Position button. The two positions may be toggled between using the Toggle Position button. * Is Second Hand Grip This is used for weapons like shotguns, where the Bolt Grab Point is also the second-hand grip point.